<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../layui/jquery-3.2.1.min.js"></script>
    <script src="../layui/jquery.query.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="js/user.js"></script>
    <link href="../layui/css/layui.css" rel="stylesheet">
</head>
<body>
<div class="layui-container">
    <span id="loginInfoDiv"></span>
    <table class="layui-table">
        <thead>
        <tr>
            <th>用户名</th>
            <th>密码</th>
            <th>角色</th>
            <th>真实姓名</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="userData"></tbody>
    </table>
    <div id="cutPageDiv"></div>

<div class="layui-row">
    <div class="layui-col-md4">
        <form id="f1">
            用户名称：<input type="text" name="userName" id="name">
            <a href="javascript:findByName(1)" class="layui-btn layui-btn-normal">
                <i class="layui-icon layui-icon-search"></i> 查询</a>
        </form>
    </div>
    <div class="layui-col-md4">
        <a href="javascript:add()" class="layui-btn">
        <i class="layui-icon layui-icon-add-circle"></i> 添加</a>
    </div>
</div>

</div>
<!--添加弹出层-->
<form class="layui-form" id="addDiv" style="display: none">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名：</label>
        <div class="layui-input-inline" style="display: flex;flex-direction: row">
            <input type="text" id="code" name="code" style="width: 150px;height: 30px" class="layui-input" placeholder="用户名"><div id="codeError"></div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名：</label>
        <div class="layui-input-block" style="display: flex;flex-direction: row">
            <input type="text" id="realName" name="realName" style="width: 150px;height: 30px" class="layui-input" placeholder="真实姓名"><div id="realNameError"></div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">拥有角色：</label>
        <div class="layui-input-block" id="roleAddDiv">

        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">拥有权限：</label>
        <span id="gradeSpan"></span><br>
    </div>
        <a class="layui-btn layui-btn-radius" href="javascript:addUser()">添加</a>
    <input type="reset" value="按钮" id="resetAddBtn" style="display: none">
    </form>


<!--修改弹出层-->
<form class="layui-form" id="updateDiv" style="display: none">
    <input type="hidden" name="id" id="id">
    用户名：<span id="userNameSpan"></span><br>
    真实姓名：<span id="realNameSpan"></span><br>
    当前角色：<br>
    <div class="layui-form-item">
        <div class="layui-input-block" id="roleChooseDiv">

        </div>
    </div>
    拥有权限：<span id="changeGradeSpan"></span><br>
    <a class="layui-btn layui-btn-radius" href="javascript:update()">修改</a>
    <input type="reset" value="按钮" id="resetBtn" style="display: none">
</form>
</body>
</html>